home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM Gold
/
Light ROM Gold.iso
/
arexx
/
m_points.lwm
< prev
next >
Wrap
Text File
|
1982-05-16
|
2KB
|
92 lines
/* CMD: Scale_On_Center
* Scale Object by it's center */
/* Nir Hermoni, zapa@datasrv.co.il
*/
libadd = addlib("LWModelerARexx.port",0)
signal on error
signal on syntax
Points_Num=XFRM_BEGIN()
if points_num ~=2 then call notify(1,'Sorry, EXACTLY 2 points in layer')
if points_num ~=2 then exit
do i = 1 to 2
pos.i = XFRM_GETPOS(i)
/* call notify(1,'vector 'i' = 'pos.i) */
x.i = subword(pos.i,1,1)
y.i = subword(pos.i,2,1)
z.i = subword(pos.i,3,1)
end i
call XFRM_END()
call req_begin "Middle points, (C) Nir Hermoni 1995"
PID = req_addcontrol("Num of points","N",0)
call req_setval PID,1
if (~req_post()) then do
call req_end
exit
end
Mid_Points = req_getval(PID)
call req_end()
dist_x =x.1-x.2
/* call notify(1,'dist_x = 'dist_x) */
dist_y =y.1-y.2
/* call notify(1,'dist_y = 'dist_y) */
dist_z =z.1-z.2
/* call notify(1,'dist_z = 'dist_z) */
/*
low_x = x.1
if x.1 > x.2 then low_x = x.2
low_y = y.1
if y.1 > y.2 then low_y = y.2
low_z = z.1
if z.1 > z.2 then low_z = z.2
*/
next_x = dist_x/(mid_points+1)
/* call notify(1,'points delta x = 'next_x) */
next_y = dist_y/(mid_points+1)
/* call notify(1,'points delta y = 'next_y) */
next_z = dist_z/(mid_points+1)
/* call notify(1,'points delta z = 'next_z) */
call ADD_BEGIN()
do i = 1 to mid_points
call ADD_POINT(x.2+i*next_x' 'y.2+i*next_y' 'z.2+i*next_z)
end i
call ADD_END()
if (libadd) then call remlib("LWModelerARexx.port")
exit
syntax:
error:
t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
if (libadd) then call remlib("LWModelerARexx.port")
exit